﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ClassLibrary.Entity;
using ClassLibrary.DAO;
using ClassLibrary.Data;

public partial class UserControl_ucCategory : System.Web.UI.UserControl
{
    TblCustomersDAO customerDAO = new TblCustomersDAO(Global.CONNECTION_STRING);
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
          //  int idCus = ((TblCustomers)Session[Global.SESSION_LOGGED_USER])
            if (Session[Global.SESSION_LOGGED_USER] != null)
            {
                
                bool idAdmin = ((TblCustomers)Session[Global.SESSION_LOGGED_USER]).IsAdmin;
                if (idAdmin == true)
                {
                    hypSearchCustomer.NavigateUrl = "~/Admin/SearchCustomer.aspx";
                    //hypSearchCustomer.Enabled = true;
                    hypSearchCustomer.Enabled = true ;

                    hpJob.NavigateUrl = "~/Admin/FindJob.aspx";
                    hyjoblist_warranty.NavigateUrl = "~/Admin/JobWarranty.aspx";
                    hypjoblist_nonwarranty.NavigateUrl = "~/Admin/JobListNonWarranty.aspx";
                    
                }
                else
                {
                   // hypSearchCustomer.Enabled = false;
                    hypSearchCustomer.Enabled = false;
                   
                    //hypSearchCustomer.NavigateUrl = "SearchCustomer.aspx";
                }
            }
        }
    }
}
